<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<!-- Set render engine for 360 browser -->
	<meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->

	<link href="/public/simpleboot/themes/<?php echo C('SP_ADMIN_STYLE');?>/theme.min.css?1" rel="stylesheet">
    <link href="/public/simpleboot/css/simplebootadmin.css?8" rel="stylesheet">
    <link href="/public/js/artDialog/skins/default.css" rel="stylesheet" />
	<link href="/public/css/other.css?<?php echo time(); ?>" rel="stylesheet" />
    <link href="/public/simpleboot/font-awesome/4.4.0/css/font-awesome.min.css"  rel="stylesheet" type="text/css">
    <style>
		form .input-order{margin-bottom: 0px;padding:3px;width:40px;}
		.table-actions{margin-top: 5px; margin-bottom: 5px;padding:0px;}
		.table-list{margin-bottom: 0px;}
	</style>
	<!--[if IE 7]>
	<link rel="stylesheet" href="/public/simpleboot/font-awesome/4.4.0/css/font-awesome-ie7.min.css">
	<![endif]-->
	<script type="text/javascript">
	//全局变量
	var GV = {
	    ROOT: "/",
	    WEB_ROOT: "/",
	    JS_ROOT: "public/js/",
	    APP:'<?php echo (MODULE_NAME); ?>'/*当前应用名*/
	};
	</script>
    <script src="/public/js/jquery.js"></script>
    <script src="/public/js/jquery.quicksearch.js"></script>
    <script src="/public/js/wind.js"></script>
    <script src="/public/simpleboot/bootstrap/js/bootstrap.min.js"></script>
    <script>
    	$(function(){
    		$("[data-toggle='tooltip']").tooltip();
    	});
    </script>
<?php if(APP_DEBUG): ?><style>
		#think_page_trace_open{
			z-index:9999;
		}
	</style><?php endif; ?>
</head>
<body>

	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
				<li class="active"><a href="javascript:;">本部卡充值明细</a></li>
		</ul>
		<form class="well form-search" id="form_search" method="post" action="">
			<?php if($is_manager): ?><select name="s_rid" style="margin:0px;">
					<option value="">请选择卡片所属机构</option>
					<?php if(is_array($logistics_list)): foreach($logistics_list as $key=>$litem): ?><option value="<?php echo ($litem['id']); ?>" <?php if($s_rid == $litem['id']): ?>selected<?php endif; ?>><?php echo ($litem["logistics_name"]); ?></option><?php endforeach; endif; ?>
				</select>
				<select name="s_sale_id" style="margin:0px;">
					<option value="">请选择消费机构</option>
					<?php if(is_array($sale_list)): foreach($sale_list as $key=>$litem): ?><option value="<?php echo ($litem['id']); ?>" <?php if($s_sale_id == $litem['id']): ?>selected<?php endif; ?>><?php echo ($litem["sale_name"]); ?></option><?php endforeach; endif; ?>
				</select>
				<select name="s_admin_id" style="margin:0px;">
					<option value="">请选择操作用户</option>
					<?php if(is_array($admin_list)): foreach($admin_list as $key=>$litem): ?><option value="<?php echo ($litem['id']); ?>" <?php if($s_admin_id == $litem['id']): ?>selected<?php endif; ?>><?php echo ($litem["user_nicename"]); ?></option><?php endforeach; endif; ?>
				</select><?php endif; ?>
			<input type="text" name="s_start_time" id="s_start_time" value="<?php echo date('Y-m-d H:i',$s_start_time); ?>" class="js-datetime" placeholder="开始时间" >
			至
			<input type="text" name="s_end_time" id="s_end_time" value="<?php echo date('Y-m-d H:i',$s_end_time); ?>" class="js-datetime" placeholder="结束时间">
			<input type="text" name="s_card_number" id="s_card_number" value="<?php echo ($s_card_number); ?>" placeholder="请输入卡号" >
			<input type="submit" class="btn btn-primary" value="搜索" />
			<a class="btn btn-primary" style="float: right;margin-left:15px;margin-bottom:10px;" href="javascript:$('.table-list').jqprint();">打印</a>
			<a class="btn btn-primary" style="float: right;" href="javascript:downloadExcel(2);">导出PDF</a>
			<input type="hidden" name="s_download" id="s_download" value="0"/>
			<a class="btn btn-primary" style="float: right;margin-right:15px;margin-bottom:10px;" href="javascript:downloadExcel(1);">导出报表</a>

		</form>
		<form class="js-ajax-form" action="" method="post">

			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>

                        <th>创建日期</th>
						<th>所属机构</th>
						<th>充值机构</th>
						<th>流水号	</th>
						<th>会员卡号</th>
						<th>充值类型</th>
						<th>支付类型</th>
						<th>充值金额</th>
						<th>平台奖励</th>
                        <th>充值赠送</th>
						<th>充值状态</th>
                        <th>充值后余额</th>

					</tr>
				</thead>
				<?php if(is_array($list)): foreach($list as $key=>$vo): ?><tr class="show_chlid">
                    <td>
						<b>
							<span class="arrow_right"></span>
						<?php echo date("Y-m-d H:i:s",$vo['create_time']);?>
					</b></td>
					<td><?php echo ($vo["logistics_name"]); ?></td>
					<td><?php echo $vo['sale_id']?$vo['sale_name']:$vo['logistics_name'];?></td>
                    <td><?php echo ($vo["number"]); ?></td>
                    <td><?php echo ($vo["card_number"]); ?></td>
                    <td><?php echo ($vo[sale_id]?'消费机构充值':'物流公司充值');?></td>
                    <td>卡帐户转账</td>
                    <td><?php echo ($vo["price"]); ?></td>
                    <td><?php echo ($vo["general_price"]); ?></td>
                    <td><?php echo ($vo["self_price"]); ?></td>
                    <td><?php echo ($vo[status] == '2'?'成功':'未完成');?></td>
                    <td><?php echo ($vo["after_balance"]); ?></td>
				</tr>
                  <tr class="tr_chlid">
                      <td colspan="10">
                          <ul>
                              <li>开卡费：<?php echo ($vo["active_price"]); ?></li>
                              <li>充值前余额：<?php echo ($vo["before_balance"]); ?></li>
                              <li>充值机构：<?php echo $vo['sale_id']?$vo['sale_name']:$vo['logistics_name'];?></li>
                              <!--<li>卡片所属机构：<?php echo ($vo["logistics_name"]); ?></li>-->
                              <li>会员姓名：<?php echo ($vo["vip_name"]); ?></li>
                              <li>会员手机：<?php echo ($vo["vip_phone"]); ?></li>
                              <li>会员车牌：<?php echo ($vo["vip_plate_number"]); ?></li>
                              <li>操作员姓名：<?php echo ($vo["user_nicename"]); ?></li>
							  <li>操作员手机号：<?php echo ($vo["user_phone"]); ?></li>
                              <li>充值描述：<?php echo ($vo["desc"]); ?></li>
	                          <li><a href="/index.php?g=Logistics&m=AdminCard&a=recharge_print&id=<?php echo ($vo["id"]); ?>" style="font-weight: bold;">补打小票</a></li>
                          </ul>
                      </td>
                  </tr><?php endforeach; endif; ?>
			</table>

			<div class="pagination"><?php echo ($page); ?></div>
		</form>
	</div>
	<script src="/public/js/common.js?<?php echo time(); ?>"></script>
	<script src="/public/js/jquery.jqprint-0.3.js"></script>
	<script>
		function refersh_window() {
			var refersh_time = getCookie('refersh_time');
			if (refersh_time == 1) {
				window.location = "<?php echo U('AdminFinance/index',$formget);?>";
			}
		}

	</script>
</body>
</html>